package user

import (
	"context"
	"home-butler/api/user"
	v1 "home-butler/api/user/v1"
)

type ControllerV1 struct{}

func NewV1() user.IUserV1 {
	return &ControllerV1{}
}

func (c ControllerV1) Login(ctx context.Context, req *v1.UserLoginReq) (res *v1.UserLoginRes, err error) {
	res = new(v1.UserLoginRes)
	res.Token = "admin-token"
	return
}

func (c ControllerV1) Info(ctx context.Context, req *v1.UserInfoReq) (res *v1.UserInfoRes, err error) {
	res = new(v1.UserInfoRes)
	res.Name = "Super Admin"
	res.Introduction = "I am a super administrator"
	res.Avatar = "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"
	roles := make([]string, 0)
	roles = append(roles, "admin")
	res.Roles = roles
	return
}
